package com.bp.ice.controller;

import com.bp.ice.entity.haveice11;
import com.bp.ice.service.iceservice11;
import com.bp.ice.vo.resultSeting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 王中林
 * 进行物品显示信息
 */
@RestController
@RequestMapping("/ice")
public class iceController {
    @Autowired
    private iceservice11 iceservice11;
    @RequestMapping("/load")
    public resultSeting load(Integer id){
        List<haveice11> ll = iceservice11.findfindleyId(id);
        return new resultSeting(ll);
    }
    @RequestMapping("/findPriceDown")
    public  resultSeting findPriceDown(){
        List<haveice11> priceDown = iceservice11.findPriceDown();
        return new resultSeting(priceDown);
    }
    @RequestMapping("/findByName")
    public resultSeting findByName(String name){
        System.out.println(name);
        List<haveice11> byName = iceservice11.findByName(name);
        System.out.println(byName);
        return new resultSeting(byName);
    }


}
